package com.miracle.main.module.mvp.model;

import com.miracle.basemvp.base.BaseModel;
import com.miracle.basemvp.base.BaseResponse;
import com.miracle.basemvp.lifecycle.rx.RxSchedulersHelper;
import com.miracle.basemvp.network.IRetrofitManager;
import com.miracle.common.mvp.entity.response.BaseListResponse;
import com.miracle.main.module.api.MainApi;
import com.miracle.main.module.mvp.contract.AddSecretContract;
import com.miracle.main.module.mvp.entity.bean.FileItem;
import com.miracle.main.module.mvp.entity.request.AddSecretRequest;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * com.miracle.main.module.mvp.model
 * (c)2018 AIR Times Inc. All rights reserved.
 *
 *
 * @author WangJQ
 * @version 1.0
 * @date 2018/7/7 11:25
 * @see com.miracle.main.module.mvp.model
 */
public class AddSecretModel extends BaseModel implements AddSecretContract.Model {

    @Inject
    public AddSecretModel(IRetrofitManager retrofitManager) {
        super(retrofitManager);
    }

    @Override
    public Observable<BaseResponse<String>> addSecret(AddSecretRequest request) {
        return mRetrofitManager
                .obtainRetrofitService(MainApi.class)
//                .addSecret(request.getUri(), request.getSaysth(), request.getIsfriendfind(),request.getJSESSIONID())
                .addSecret(request)
                .compose(RxSchedulersHelper.<BaseResponse<String>>io_main());
    }
}
